package com.wellink.android_demo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    private EditText usrName = null;
    private EditText usrPwd = null;
    private Button btnLogin = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.login_layout);

        usrName = findViewById(R.id.usrName);
        usrPwd = findViewById(R.id.usrPwd);
        btnLogin = findViewById(R.id.btnLogin);

        btnLogin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String name = usrName.getText().toString();
                String pwd = usrPwd.getText().toString();

                Toast.makeText(MainActivity.this,
                        "用户名：" + name+"\n密码："+pwd,Toast.LENGTH_LONG).show();
            }
        });
    }
}
